package org.chen.common.translate.dto;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.List;

/**
 * 百度翻译响应DTO
 */
@Schema(description = "百度翻译响应结果")
@Data
public class BaiduTranslateResponseDTO {
    
    @JsonProperty("from")
    @Schema(description = "原文语言")
    private String from;
    
    @JsonProperty("to")
    @Schema(description = "译文语言")
    private String to;
    
    @JsonProperty("trans_result")
    @Schema(description = "翻译结果列表")
    private List<TransResult> transResult;

    @JsonProperty("error_code")
    private String errorCode;
    @JsonProperty("error_msg")
    private String errorMsg;
    
    /**
     * 翻译结果项
     */
    @Data
    @Schema(description = "翻译结果项")
    public static class TransResult {
        @Schema(description = "原文")
        private String src;
        
        @Schema(description = "译文")
        private String dst;
    }
}